home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
clipper
/
code_1.zip
/
TEM_UDFS.PRG
< prev
Wrap
Text File
|
1989-01-02
|
51KB
|
1,023 lines
* SYS_UDF.PRG
* User Defined Functions by Gary L. Cota
* created: 11/25/88
* last update: 01/01/89
*
***************************************************************************
* To Whom It May Concern: *
* --------------------------------------------------------------------- *
* The program code contained herein is a combination of User Defined *
* Functions (UDFs) created by myself and functions collected from *
* other various sources. These sources include DATA BASED ADVISOR *
* magazine, "PROGRAMMING IN CLIPPER" (first and second editions by *
* Stephen Straley, D.O.S.S (Desk Of Stephen Straley newsletter, the *
* REFERENCE(CLIPPER) newsletter to name but a few. I make no claim *
* to ownership of these functions. They are available your use but *
* with no guarantee, warranty, or royalty involved from myself. *
* *
* NOTE: These functions were created for use with CLIPPER SUMMER '87 *
* Version only. It is possible that some may work with the *
* AUTUMN '86 Version but none have been tested with that ver- *
* sion. *
* *
* NOTE: The function names are prefixed with a "c_" to (hopefully) *
* make them unique to current and future versions of CLIPPER *
* and third party UDF libraries. *
* *
* All local variables are prefixed with a "_" (underscore) as *
* in "_in_string". Temporary work variables are prefixed and *
* suffixed with an underscore as in _ma_, _mb_, _mc_, etc. to *
* hopefully prevent any duplicate program memory variable *
* names or CLIPPER reserved words. *
* *
* Gary L. Cota 11/25/88 *
***************************************************************************
*
*
*
FUNCTION c_ALLTRIM
************************************************************************
* PASS: <expC1> *
* *
* RETURNS: The character string minus trimmed leading and trailing *
* spaces. *
* *
* PURPOSE: Uses less memory space than it's CLIPPER counterpart. *
* *
* EXAMPLE: mfirst = FIRST_NAME *
* mlast = LAST_NAME *
* ? c_ALLTRIM(mfirst)+" "+c_ALLTRIM(mlast) *
************************************************************************
*
PARAMETERS _in_string
*
RETURN(LTRIM(TRIM(_in_string)))
*
*
*
FUNCTION c_BLANK
************************************************************************
* PASS: <expC1>, <expC2> (optional) *
* *
* RETURNS: The empty or blank value of a .DBF field. *
* *
* PURPOSE: Initialize blank or empty memory variables from .DBF *
* fields. *
* *
* NOTES: If second paramater is passed, logical fields will be *
* initialized to .F. (false). If a second parameter is not *
* passed, logical fields will be initialized to a character *
* string of SPACE(1). *
* *
* This function may be used in conjunction with the *
* c_DATAGONE() and c_MEMEMPTY() UDFs. *
* *
* EXAMPLE: mCUSTOMER = c_BLANK(CUSTOMER) *
* (where mCUSTOMER is a memory variable and CUSTOMER is a *
* .DBF field name. *
* *
* MBILLABLE = c_BLANK(BILLABLE) *
* (memory variable is initialized to " ") *
* *
* MBILLABLE = c_BLANK(BILLABLE,x) *
* (memory variable is initialized to .F.) *
************************************************************************
*
PARAMETERS _in_string, _my_
*
DO CASE
CASE TYPE("_in_string")="C"
* Character
RETURN(SPACE(LEN(_in_string)))
*
CASE TYPE("_in_string")="D"
* Date
RETURN(CTOD(" / / "))
*
CASE TYPE("_in_string")="L"
* Logical
IF PCOUNT() = 2
*****************************************************
* Second parameter passed. Logical memory variable *
* will be initialized to .F.. *
*****************************************************
RETURN(.F.)
ELSE
*****************************************************
* If one parameter passed, convert logical field to *
* character memory variable of SPACE(1). *
*****************************************************
RETURN(SPACE(1))
ENDIF
*
CASE TYPE("_in_string")="M"
* Memo
RETURN(SPACE(512))
*
CASE TYPE("_in_string")="N"
* Numeric
RETURN(0.00)
*
OTHERWISE
RETURN(.F.)
ENDCASE
RETURN(0)
*
*
*
FUNCTION c_BOXIT
************************************************************************
* PASS: <expN1>, <expN2>, <expN3>, <expN4>, <expN5>, <expC1> *
* *
* where: <expN1> = top row *
* <expN2> = top column *
* <expN3> = bottom row *
* <expN4> = bottom column *
* <expN5> = box type 1-4 (1 is single line box, 2 *
* is double line box, 3 is double line *
* top and bottom and single line sides, *
* and 4 is single line top and bottom *
* and double line sides). *
* <expC1> = optional box color parameter *
* *
* RETURNS: Nothing *
* *
* PURPOSE: Clears area and displays a box or window. *
* *
* EXAMPLE: mboxtype = 1 && single line box *
* mboxcolor = "+BG/N" && color variable *